<#-- 引入布局指令的命名空间 -->
<#import "/layout/defaultLayout.ftl" as defaultLayout>
<#--<script src="https://unpkg.com/axios/dist/axios.min.js"></script>-->

<#-- 调用布局指令 -->
<@defaultLayout.layout>

<#-- 将下面这个main content嵌入到layout指令的nested块中 -->

<style>
    #fingerPrint_GB1 {
        display: flex;
        justify-content: center;
    }

    .box-card {
        margin: 30px;
        width: 80%;
    }
</style>
<div id="fingerPrint_GB1">
    <el-card class="box-card">
        <div slot="header" class="clearfix">
            <span>来呀，配置fingerPrint_GB1呀：</span>
            <el-tooltip
                    content="一条配置数据占一行，用英文逗号分隔：{force},{velocity}。配置文件在家目录下preLoadingRate文件夹下的fingerPrint_GB1.txt文件中。"
                    placement="top">
                <i class="el-icon-warning-outline"></i>
            </el-tooltip>
            <el-button
                    style="float: right; padding: 3px 0" type="text"
                    v-on:click="fingerPrintGB1DataEdit">
                提交修改
            </el-button>
        </div>
        <el-input
                type="textarea"
                :rows="18"
                placeholder="请输入内容"
                v-model="fingerPrintGB1Data">
        </el-input>


    </el-card>
</div>

<script>
    new Vue({
        el: '#fingerPrint_GB1',
        data: function () {
            return {
                fingerPrintGB1Data: []
            };
        },
        methods: {
            loadAll: function () {
                var _this = this;
                axios({
                    method: 'get',
                    url: '/conf/getFingerPrintGB1.htm',
                    data: {
                        'fingerPrintGB1Data': _this.fingerPrintGB1Data
                    }
                }).then(function (response) {
                    console.log(response.data);
                    _this.fingerPrintGB1Data = response.data.fingerPrintGB1Data;

                });
            },
            fingerPrintGB1DataEdit: function () {
                var _this = this;
                axios({
                    method: 'post',
                    url: '/conf/editFingerPrintGB1.htm',
                    data: {
                        'fingerPrintGB1Data': _this.fingerPrintGB1Data
                    }
                }).then(function (response) {
                    console.log("修改之后的配置为：");
                    console.log(response);
                    _this.editRspAlert(response.data);

                })
            },
            editRspAlert: function (respData) {
                if ("0000" === respData.responseCode) {
                    this.$alert('修改fingerPrint_GB1成功', '提示', {
                        confirmButtonText: '确定',
                    });
                }else {
                    this.$alert(respData.responseMsg, '修改失败', {
                        confirmButtonText: '确定',
                    });
                }
            }
        },
        mounted: function () {
            this.fingerPrintGB1Data = this.loadAll();
        }
        ,
    })
</script>

</@defaultLayout.layout>
